package com.example.democlient.controller;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;

/**
 * 测试线程方法
 */
public class ThreadTest {




    public static void main(String[] args) {

       /* ExecutorService threadPool = new ThreadPoolExecutor(
                2,// 两个常开营业窗口
                5,// 五个窗口，其中三个应急用
                3,// 超时存货时间
                TimeUnit.SECONDS,// 超时时间单位
                new LinkedBlockingDeque<>(3),// 银行候客区大小
                Executors.defaultThreadFactory(),// 默认线程池工厂
                new ThreadPoolExecutor.AbortPolicy());

        MyTask myTask = new MyTask();

        //向线程池添加任务
        for(int i = 0; i < 2; i++){
            threadPool.execute(myTask);
        }

        threadPool.shutdown();*/

       /* List<Integer> integerList = Arrays.asList(1,2,3,4,5);

        List<Integer> integerList1 = new ArrayList<>();
        System.out.println(integerList);
        for(Integer i:integerList){
            i = i+1;
            integerList1.add(i);
        }*/

      /* String s = "1";
       String[] e = s.split(",");
       List<String> list = Arrays.asList(e);
      for(String ssss:list){
          System.out.println(ssss);
      }
*/
    /*    String[] s = "I Love You But I miss You so I miss you".split(" ");
        List<String> list = Arrays.asList(s);
        // 流转List
        list.stream().filter(str -> str.length() > 3).forEach(System.out::println);

        Stream.of(5,4,3,5,4).distinct().forEach(System.out::println);

        IntStream.range(0,4).forEach(i -> System.out.print(i +"..."));*/

       /* String r = "t,b";
        String[] split = r.split(",");
        for(String ss:split){
            System.out.println(ss);
        }*/

       String ss = "小孩，大人，文件，事情，奇葩";
       List<String> list = Arrays.asList("i","奇t葩");

       boolean b = list.stream().anyMatch(r->ss.indexOf(r)!=-1);
        System.out.println(b);




    }


}
